<%--
    Document   : userAdd
    Created on : 8 Mar, 2012, 3:23:38 PM
    Author     : Akil Mahimwala
--%>


<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@include file="../common/script.jsp" %>
<!DOCTYPE html>
<script type="text/javascript">
    var rules=new Array();
    rules[0]='username|required|Please Enter UserName';
    rules[1]='password|required|Please Enter Password';
    rules[2]='name|required|Please Enter Name';
    
</script>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <%@include file="../common/title.jsp" %>
    </head>
    <body onLoad="yav.init('form1',rules,'inline');">
        <%@include file="../common/header.jsp" %>
        <%@include file="../common/menu.jsp" %>
        <div class="in_02">
            <%@include file="../common/message.jsp" %>
            <form:form id="form1" name="form1" commandName="user"  method="POST">
                <fieldset>
                    <legend><spring:message code="title.editUser"/></legend>
                    <table class="formTable">
                        <tr>
                            <td><spring:message code="username"/>:<br/>
                                <form:input path="username" class="userInputLarge"/>
                                <br/><span id="errorsDiv_username"></span></td>
                            <td><spring:message code="password"/>:<br/>
                                <form:password path="password" class="userInputLarge"/>
                                <br/><span id="errorsDiv_password"></span></td>
                        </tr>
                        <tr>
                            <td><spring:message code="role"/>:<br/>
                                <form:select path="role.roleId" items="${roleList}" itemLabel="roleName" itemValue="roleId" class="userInputLarge"/></td>
                            <td><spring:message code="active"/>:<br/><spring:message code="yes"/> <form:radiobutton path="active" value="true"/>&nbsp;&nbsp;&nbsp;<spring:message code="no"/> <form:radiobutton path="active" value="false"/></td>
                        </tr>
                        <tr>
                            <td><input type="button" name="btnCancel" value="<spring:message code="button.Cancel"/>" onclick="location.href='../admin/userList.htm'" /></td>
                            <td><input type="submit" name="btnSubmit" value="<spring:message code="button.Update"/>" onclick="return yav.performCheck('form1', rules, 'inline');"/></td>
                            
                        </tr>
                        <spring:hasBindErrors name="user">
                            <div class="error">
                                <form:errors path="*"/>
                            </div>
                        </spring:hasBindErrors>

                    </table>
                </fieldset>
            </form:form></div>
    </body>
</html>
